<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateWaimaiOrderIdShopIdMappingsTables extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::connection('mysqlWaiMaiAll')->create('waimai_order_id_shop_id_mappings', function (Blueprint $table) {
            $table->unsignedBigInteger("orderId")->primary();
            $table->unsignedInteger("shopId")->default(0);
            $table->unsignedTinyInteger("sourceType")->default(0)->comment('3美团 4饿了么');

            $table->collation = 'utf8mb4_general_ci';
            $table->comment = '外卖orderId关联shopId映射表';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::connect('mysqlWaiMaiAll')->dropIfExists('waimai_order_id_shop_id_mappings');
    }
}
